package route

import (
	"go-gin-api/app/controller"
	"go-gin-api/app/middleware"

	"github.com/gin-gonic/gin"
)

// OtherRouter github 路由
func OtherRouter(r *gin.Engine) {
	OtherRouter := r.Group("/other")
	{
		// 获取开源项目
		OtherRouter.GET("/githubList", controller.GetGithubList)
		OtherRouter.GET("/images", controller.GetImagesList)
		auth := OtherRouter.Group("")
		auth.Use(middleware.AuthRequired())
		{
			auth.POST("/addGithub", controller.AddGithub)
			auth.GET("/getGithub", controller.GetGithubByID)
			auth.GET("/deleteGithub", controller.DeleteGithubByID)
			auth.POST("/upload", controller.UploadImage)
		}
	}
}
